package me.firstapp.module.weixin.order;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import me.firstapp.module.base.BaseEntity;

@Entity
@Table(name = "PRODUCT_ORDER")
public class ProductOrder extends BaseEntity {

	private static final long serialVersionUID = -2587801761520927842L;

	public static final int STATUS_NOT_PAY = 0;
	public static final int STATUS_PAYED = 1;
	public static final int STATUS_COMPLETE = 2;
	public static final int STATUS_CANCEL = 3;
	public static final int STATUS_RETURN = 4;
	public static final String ORDER_NO_START = "P";
	public static final int SETTLE_FLAG_NOT = 0;
	public static final int SETTLE_FLAG_YES = 1;

	// 订单号
	@Column(name = "ORDER_NO", length = 50, unique = true, nullable = false)
	private String orderNo;

	// 微信openId
	@Column(name = "OPEN_ID", length = 40, nullable = false)
	private String openId;

	// 卡号
	@Column(name = "CARD_NO", length = 40, nullable = false)
	private String cardNo;

	// 上级微信openId
	@Column(name = "CHIEF_OPEN_ID", length = 40, nullable = false)
	private String chiefOpenId;

	// 上级卡号
	@Column(name = "CHIEF_CARD_NO", length = 40, nullable = false)
	private String chiefCardNo;

	// 供应商ID
	@Column(name = "SUPPLIER_ID", nullable = false)
	private Long supplierId;

	// 商品ID
	@Column(name = "PRODUCT_ID", nullable = false)
	private Long productId;

	// 商品名称(冗余，仅用于显示)
	@Column(name = "NAME", length = 50, nullable = false)
	private String name;

	// 规格名称
	@Column(name = "SKU_NAME", length = 20, nullable = false)
	private String skuName;

	// 商品图片链接(冗余，仅用于显示)
	@Column(name = "IMG_URL", length = 500, nullable = false)
	private String imgUrl;

	// 商品详情链接
	@Column(name = "DETAIL_URL", length = 500, nullable = false)
	private String detailUrl;

	// 商品外部链接
	@Column(name = "OUT_URL", length = 500)
	private String outUrl;

	// 商品单价(冗余，仅用于显示)
	@Column(name = "PRODUCT_PRICE", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal productPrice;

	// 单位
	@Column(name = "UNIT", length = 10, nullable = false)
	private String unit;

	// 商品数量
	@Column(name = "COUNTS", nullable = false)
	private Integer counts;

	// 商品金额
	@Column(name = "PRODUCT_AMOUNT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal productAmount;

	// 运费
	@Column(name = "FREIGHT_AMOUNT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal freightAmount;

	// 订单总金额
	@Column(name = "TOTAL_AMOUNT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal totalAmount;

	// 支付金额
	@Column(name = "PAY_AMOUNT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal payAmount;

	// 赠送的积分值
	@Column(name = "GIVE_POINT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal givePoint;

	// 粉丝购买，赠送给上级代理额外的贝币
	@Column(name = "FANS_BUY_GIVE_OTHER_JB", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal fansBuyGiveOtherJb;

	// 会员购买，赠送给上级代理额外的贝币
	@Column(name = "BASE_VIP_BUY_GIVE_OTHER_JB", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal baseVipBuyGiveOtherJb;

	// 代理购买，赠送给上级代理额外的贝币
	@Column(name = "HIGH_VIP_BUY_GIVE_OTHER_JB", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal highVipBuyGiveOtherJb;

	// 上级基础会员贝币分成
	@Column(name = "CHIEF_BASE_VIP_JIN_BI", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal chiefBaseVipJinBi;

	// 上级高级代理贝币分成
	@Column(name = "CHIEF_HIGH_VIP_JIN_BI", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal chiefHighVipJinBi;

	// 上级实际获取的贝币
	@Column(name = "CHIEF_JIN_BI", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal chiefJinBi;

	// 上上级实际获取的贝币
	@Column(name = "CHIEF_CHIEF_JIN_BI", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal chiefChiefJinBi;

	// 上级基础会员积分分成
	@Column(name = "CHIEF_BASE_VIP_POINT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal chiefBaseVipPoint;

	// 上级高级代理积分分成
	@Column(name = "CHIEF_HIGH_VIP_POINT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal chiefHighVipPoint;

	// 上级实际获取的积分
	@Column(name = "CHIEF_POINT", columnDefinition = "DECIMAL(11, 4)")
	private BigDecimal chiefPoint;

	// 订单状态0,未支付;1,已支付;2,已完成;3,已取消;4,已退货;
	@Column(name = "STATUS", columnDefinition = "TINYINT DEFAULT 0", nullable = false)
	private Integer status;

	// 订单创建时间
	@Column(name = "CREATE_TIME", columnDefinition = "DATETIME", nullable = false)
	private Date createTime;

	// 支付时间
	@Column(name = "PAY_TIME", columnDefinition = "DATETIME")
	private Date payTime;

	// 记账日
	@Column(name = "ACCOUNT_DATE", columnDefinition = "DATE")
	private Date accountDate;

	// 完成时间
	@Column(name = "COMPLETE_TIME", columnDefinition = "DATETIME")
	private Date completeTime;

	// 取消时间
	@Column(name = "CANCEL_TIME", columnDefinition = "DATETIME")
	private Date cancelTime;

	// 退货时间
	@Column(name = "RETURN_TIME", columnDefinition = "DATETIME")
	private Date returnTime;

	// 客户备注
	@Column(name = "REMARK", length = 200)
	private String remark;

	// 系统备注
	@Column(name = "SYS_REMARK", length = 200)
	private String sysRemark;

	// 结算标志，0未结算；1已结算
	@Column(name = "SETTLE_FLAG", columnDefinition = " TINYINT DEFAULT 0 ", nullable = false)
	private Integer settleFlag;

	// 结算时间
	@Column(name = "SETTLE_TIME", columnDefinition = "DATETIME")
	private Date settleTime;

	// 收货人姓名
	@Column(name = "RECEIVE_NAME", length = 20, nullable = false)
	private String receiveName;

	// 收货人手机号
	@Column(name = "RECEIVE_MOBILE", length = 11, nullable = false)
	private String receiveMobile;

	// 收货人地址
	@Column(name = "RECEIVE_ADDRESS", length = 300, nullable = false)
	private String receiveAddress;

	// 快递名称
	@Column(name = "FREIGHT_NAME", length = 80)
	private String freightName;

	// 快递单号
	@Column(name = "FREIGHT_NO", length = 80)
	private String freightNo;

	// 外部平台名称
	@Column(name = "OUT_SYS_NAME", length = 30)
	private String outSysName;

	// 外部平台订单号
	@Column(name = "OUT_ORDER_NO", length = 80)
	private String outOrderNo;

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getChiefOpenId() {
		return chiefOpenId;
	}

	public void setChiefOpenId(String chiefOpenId) {
		this.chiefOpenId = chiefOpenId;
	}

	public String getChiefCardNo() {
		return chiefCardNo;
	}

	public void setChiefCardNo(String chiefCardNo) {
		this.chiefCardNo = chiefCardNo;
	}

	public Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public BigDecimal getProductPrice() {
		return productPrice;
	}

	public void setProductPrice(BigDecimal productPrice) {
		this.productPrice = productPrice;
	}

	public Integer getCounts() {
		return counts;
	}

	public void setCounts(Integer counts) {
		this.counts = counts;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public BigDecimal getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(BigDecimal totalAmount) {
		this.totalAmount = totalAmount;
	}

	public BigDecimal getProductAmount() {
		return productAmount;
	}

	public void setProductAmount(BigDecimal productAmount) {
		this.productAmount = productAmount;
	}

	public BigDecimal getFreightAmount() {
		return freightAmount;
	}

	public void setFreightAmount(BigDecimal freightAmount) {
		this.freightAmount = freightAmount;
	}

	public BigDecimal getPayAmount() {
		return payAmount;
	}

	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}

	public BigDecimal getGivePoint() {
		return givePoint;
	}

	public void setGivePoint(BigDecimal givePoint) {
		this.givePoint = givePoint;
	}

	public BigDecimal getChiefBaseVipJinBi() {
		return chiefBaseVipJinBi;
	}

	public void setChiefBaseVipJinBi(BigDecimal chiefBaseVipJinBi) {
		this.chiefBaseVipJinBi = chiefBaseVipJinBi;
	}

	public BigDecimal getChiefHighVipJinBi() {
		return chiefHighVipJinBi;
	}

	public void setChiefHighVipJinBi(BigDecimal chiefHighVipJinBi) {
		this.chiefHighVipJinBi = chiefHighVipJinBi;
	}

	public BigDecimal getChiefBaseVipPoint() {
		return chiefBaseVipPoint;
	}

	public void setChiefBaseVipPoint(BigDecimal chiefBaseVipPoint) {
		this.chiefBaseVipPoint = chiefBaseVipPoint;
	}

	public BigDecimal getChiefHighVipPoint() {
		return chiefHighVipPoint;
	}

	public void setChiefHighVipPoint(BigDecimal chiefHighVipPoint) {
		this.chiefHighVipPoint = chiefHighVipPoint;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getAccountDate() {
		return accountDate;
	}

	public void setAccountDate(Date accountDate) {
		this.accountDate = accountDate;
	}

	public Date getCompleteTime() {
		return completeTime;
	}

	public void setCompleteTime(Date completeTime) {
		this.completeTime = completeTime;
	}

	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	public Date getCancelTime() {
		return cancelTime;
	}

	public void setCancelTime(Date cancelTime) {
		this.cancelTime = cancelTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getSettleFlag() {
		return settleFlag;
	}

	public void setSettleFlag(Integer settleFlag) {
		this.settleFlag = settleFlag;
	}

	public Date getSettleTime() {
		return settleTime;
	}

	public void setSettleTime(Date settleTime) {
		this.settleTime = settleTime;
	}

	public String getReceiveName() {
		return receiveName;
	}

	public void setReceiveName(String receiveName) {
		this.receiveName = receiveName;
	}

	public String getReceiveMobile() {
		return receiveMobile;
	}

	public void setReceiveMobile(String receiveMobile) {
		this.receiveMobile = receiveMobile;
	}

	public String getReceiveAddress() {
		return receiveAddress;
	}

	public void setReceiveAddress(String receiveAddress) {
		this.receiveAddress = receiveAddress;
	}

	public String getFreightNo() {
		return freightNo;
	}

	public void setFreightNo(String freightNo) {
		this.freightNo = freightNo;
	}

	public Date getReturnTime() {
		return returnTime;
	}

	public void setReturnTime(Date returnTime) {
		this.returnTime = returnTime;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public Long getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(Long supplierId) {
		this.supplierId = supplierId;
	}

	public String getFreightName() {
		return freightName;
	}

	public void setFreightName(String freightName) {
		this.freightName = freightName;
	}

	public String getDetailUrl() {
		return detailUrl;
	}

	public void setDetailUrl(String detailUrl) {
		this.detailUrl = detailUrl;
	}

	public BigDecimal getChiefJinBi() {
		return chiefJinBi;
	}

	public void setChiefJinBi(BigDecimal chiefJinBi) {
		this.chiefJinBi = chiefJinBi;
	}

	public BigDecimal getChiefPoint() {
		return chiefPoint;
	}

	public void setChiefPoint(BigDecimal chiefPoint) {
		this.chiefPoint = chiefPoint;
	}

	public BigDecimal getChiefChiefJinBi() {
		return chiefChiefJinBi;
	}

	public void setChiefChiefJinBi(BigDecimal chiefChiefJinBi) {
		this.chiefChiefJinBi = chiefChiefJinBi;
	}

	public String getOutSysName() {
		return outSysName;
	}

	public void setOutSysName(String outSysName) {
		this.outSysName = outSysName;
	}

	public String getOutOrderNo() {
		return outOrderNo;
	}

	public void setOutOrderNo(String outOrderNo) {
		this.outOrderNo = outOrderNo;
	}

	public String getOutUrl() {
		return outUrl;
	}

	public void setOutUrl(String outUrl) {
		this.outUrl = outUrl;
	}

	public BigDecimal getFansBuyGiveOtherJb() {
		return fansBuyGiveOtherJb;
	}

	public void setFansBuyGiveOtherJb(BigDecimal fansBuyGiveOtherJb) {
		this.fansBuyGiveOtherJb = fansBuyGiveOtherJb;
	}

	public BigDecimal getBaseVipBuyGiveOtherJb() {
		return baseVipBuyGiveOtherJb;
	}

	public void setBaseVipBuyGiveOtherJb(BigDecimal baseVipBuyGiveOtherJb) {
		this.baseVipBuyGiveOtherJb = baseVipBuyGiveOtherJb;
	}

	public BigDecimal getHighVipBuyGiveOtherJb() {
		return highVipBuyGiveOtherJb;
	}

	public void setHighVipBuyGiveOtherJb(BigDecimal highVipBuyGiveOtherJb) {
		this.highVipBuyGiveOtherJb = highVipBuyGiveOtherJb;
	}

	public String getSysRemark() {
		return sysRemark;
	}

	public void setSysRemark(String sysRemark) {
		this.sysRemark = sysRemark;
	}

	public String getSkuName() {
		return skuName;
	}

	public void setSkuName(String skuName) {
		this.skuName = skuName;
	}

}
